home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 27.zip
/
BS1 part 27
/
ImageMaster_d3.adf
/
piarc.lzh.parta
/
eroder.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-03-23
|
2KB
|
95 lines
/*
* ERODER.rexx ( calls the erode command )
*
* Written by: Barry Chalmers and Ben Williams
* Last Update: January 17th, 1992
* Revision: 1.01
* For: Black Belt Systems image processing series IM, IM F/c, and IP.
*/
call pragma('stack',20000);
/*
* open rexxsupport.library -- needed for some functions
*/
if ~show('L',"rexxsupport.library") then do
if addlib('rexxsupport.library',0,-30,0) then do
/* everything's ok */
end;
else do
say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
say 'Cannot operate this module without the library - sorry!';
exit 10;
end;
end;
prtnme = 'IP_Port'; /* assume Image Professional */
if show('P','IP_Port') = 0 then do
if show('P','IM_Port') = 0 then do
say "Can't find image processor's ARexx port!!!"; /* not running? */
say "This script requires IP, IM or IM F/c to run!";
exit(20);
end;
else do
prtnme = 'IM_Port';
end;
end;
address(prtnme);
/*
* This code attempts to read a file called "picmdpath" from REXX:
* If it can't find it, the script will assume that the commands
* associated with this PI Module are in "c:". If the file exists,
* the script will look in the path that is specified in the file.
* If you create this file, you MUST put a complete, correct path
* in it; if the commands are in a sub-directory, you have to put
* the trailing slash on the path (like, device:dir/).
*
*/
cmdpath = 'c:';
if open(fhandle,'rexx:picmdpath','read') then /* open the file */
do
cmdpath = readln(fhandle);
call close(fhandle); /* close the file */
end
'tofront';
options results;
'gadgets "Brightness Erode","","Brightness Dilate",""';
emode = result-1;
options;
if emode < 0 then do
address;
exit 0;
end
'fchide';
options results;
'askprop "Cell size:" 6 2 20';
edge = result;
options;
'fcshow';
'backuptoundo';
'area';
options results;
'jackin';
jack = result;
'current';
bufdata = result;
options;
parse var bufdata bname ',' bnum ',' brest
'lockimage '||bnum;
address command cmdpath||'erode '||jack||' '||edge||' '||emode;
'unlockimage '||bnum;
address(prtnme);
'redraw';
address;
exit 0;